package com.eascs.ticket.user.controller;

import java.util.List;

import javax.inject.Inject;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.eascs.site.controller.BaseRestController;
import com.eascs.site.view.BaseRestResult;
import com.eascs.ticket.user.form.AutocompleteForm;
import com.eascs.ticket.user.service.UserService;

@RestController
public class UserRestController extends BaseRestController {
	@Inject
	private UserService userService;

	@RequestMapping(value = "/user/autocomplete")
	public BaseRestResult<List<Object[]>> autocomplete(AutocompleteForm autocompleteForm) {
		return BaseRestResult.buildRestResult(userService.searchUserByWord(autocompleteForm.getKey()));
	}

}